package cn.SiFuLan.controls;

import cn.SiFuLan.dao.IspuDao;
import cn.SiFuLan.dao.impl.spuDaoImpl;
import cn.SiFuLan.entity.spuEntity;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet(urlPatterns = "/admin/update.do")
public class updateServlt extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req,resp);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        IspuDao ispuDao=new spuDaoImpl();
        List<spuEntity> spu= ispuDao.all();
        request.setAttribute("spu",spu);
        request.getRequestDispatcher("update.jsp").forward(request,response);
    }
}
